CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )

SET( PROJECT_NAME_TEMP "XiolLib" )

INCLUDE( FindXInput.cmake )

#MESSAGE("XINPUT:")
#MESSAGE("Found:	${XINPUT_FOUND}")
#MESSAGE("Include: ${XInput_INCLUDE_DIR}")
#MESSAGE("Lib: ${XInput_LIBRARY}")

IF( XINPUT_FOUND )

	PROJECT( ${PROJECT_NAME_TEMP} )

	INCLUDE_DIRECTORIES( ${XInput_INCLUDE_DIR} )

	ADD_DEFINITIONS( -DUNICODE -D_UNICODE )		
	SET	(	SOURCES
			XiolTime.h
			XiolTime.cpp
			XiolControllerState.h
			XiolControllerState.cpp 
			XiolVibrationMotorState.h
			XiolVibrationMotorState.cpp
			XiolController.h
			XiolController.cpp
			XiolControllerEnumerationTrigger.h
			XiolControllerEnumerationTrigger.cpp
			XiolControllerManager.h
			XiolControllerManager.cpp 
		)
	ADD_LIBRARY( ${PROJECT_NAME} STATIC ${SOURCES} )
	TARGET_LINK_LIBRARIES( ${PROJECT_NAME} ${XInput_LIBRARY} ) 

ELSE()
	
	MESSAGE("Can't find XInput library. Project ${PROJECT_NAME_TEMP} won't be compiled")

ENDIF()
